package com.xx.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class P1Controller {


    @HystrixCommand(fallbackMethod = "infoHystrix")
    @RequestMapping("/info")
    public String info() {
        String res = "provider01-" + System.currentTimeMillis();
        log.info(res);
        return res;
    }

    @RequestMapping("/provider00/info")
    public String infotemp() {
        return "ddd-provider01-" + System.currentTimeMillis();
    }

    public String infoHystrix() {
        return "infoHystrix-" + System.currentTimeMillis();
    }
}
